package com.ulook.lookplanet.data.repository;

import com.ulook.lookplanet.data.source.TopicDataSource;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/4/21
 */
public class TopicRepository {

    private static TopicRepository instance;
    private TopicDataSource dataSource;

    private TopicRepository(TopicDataSource dataSource){
        this.dataSource = dataSource;
    }

    public static TopicRepository getInstance(){
        if(instance == null){
            instance = new TopicRepository(new TopicDataSource());
        }
        return instance;
    }

    /**
     * 根据小组id获取帖子
     */
    public void getArticlesForComuId(String uid, int currUserId, int itemNum, ResponseCallback callback){
        dataSource.getArticlesForComuId(uid, currUserId, itemNum, callback);
    }

    /**
     * 根据话题id获取帖子
     */
    public void getArticlesForTopicId(String uid, int currUserId, int itemNum, ResponseCallback callback){
        dataSource.getArticlesForTopicId(uid, currUserId, itemNum, callback);
    }
}
